/**
 * @file password.c
 * @author      JinChengLong (https://gitee.com/Datejin/)
 * @brief       设置密码
 * @version     0.1
 * @date        2023
 * 
 * @copyright   Copyright © 2025 by JinChengLong 
 * 
 * All rights reserved.
 * Unauthorized copying, reproduction, or redistribution of this file via any medium is strictly prohibited.  
 * Proprietary and confidential.
 *   
 */
#include "password.h"

extern uint32_t ALarm,ass;

/**
 * @brief 秘密锁
 * 
 */
void   password_me(void)
{
	//LCD_Fill(0,0,128,160,WHITE );
	background();
	while (1)
	{
		//LCD_ShowChinese(1,1,"请输入密码",WHITE,WHITE,16,1);
		//LCD_Fill(40,42,80,58,WHITE );
		
		RTC_SetAlarm(ALarm);
		mimajiemian(0);
		
		
		if(RTC_GetFlagStatus(RTC_FLAG_ALR)==1)
		{
			PWR_EnterSTANDBYMode();
			//先清除WAKEUP标志位//选择STANDBY模式PDDS置一进入待机模式//SLEEPDEEP置一进入深度睡眠//调用WFI进入待机模式
		}	
		
		if(conde !=20)
		{
			mima_key(conde );
			ALarm= ass;
			//LCD_Fill (40,42,80,60,WHITE);
		}	
		
		else if(conde ==20 &key1()==1)//&& conde ==20 &
		{
			ALarm=RTC_GetCounter()+10;
			if(mima_P()==0 )
			{
				LCD_ShowIntNum(70,150,mima[3],1,LGRAY ,BLACK,12);
				LCD_ShowIntNum(64,150,mima[2],1,LGRAY ,BLACK,12);
				LCD_ShowIntNum(58,150,mima[1],1,LGRAY ,BLACK,12);
				LCD_ShowIntNum(52,150,mima[0],1,LGRAY ,BLACK,12);
				
				
				Delay_ms (200);
			}
			else if(mima_P()==1 )
			{
				//LCD_Fill (40,42,80,60,WHITE);
				break;
			}
		}
	}

}	
	
	

	
	
	
	
	
	
	
	
	
	
	
	
	
	








